﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace BiSA
{
    class TFBindingSitesDetails
    {
        public string TFName = "";
        public string CellLine = "";
        public string RefGenome;
        public string TotalIntervals = "";

        public TFBindingSitesDetails(string TFBindingSitesDetailsId)
        {
            string sql = "";
            sql = "select *, (select count(*) TotalIntervals from TFBindingSites where TFBindingSitesDetailsId=@TFBindingSitesDetailsId ) TotalIntervals";
            sql += " from TFBindingSitesDetails where TFBindingSitesDetailsId=@TFBindingSitesDetailsId";
            SqlCommand cm = MKDataAccesser.CreateCommand(sql, CommandType.Text);
            cm.Parameters.Add(new SqlParameter("@TFBindingSitesDetailsId", TFBindingSitesDetailsId));
            DataSet ds = MKDataAccesser.GetRecord(cm);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                TFName = dr["TFName"].ToString();
                CellLine = dr["CellLine"].ToString();
                TotalIntervals = dr["TotalIntervals"].ToString();
                //EnteredTime = dr["EnteredTime"];
            }
        }
    }
}
